<?php
class Subscribers extends CActiveRecord {

    public $id;
    public $type;
    public $typeId;
    public $email;
    public $unreg;
    
    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    public function tableName() {
        return 'subscribers';
    }
    
    public function beforeValidate() {
        $this->attributes = !empty($_POST[get_class($this)]) ? $_POST[get_class($this)] : array();
    }
    
    public function rules() {
        return array(
            array('pageUrl', 'required', 'message'=>'{attribute} не может быть пустым'),
            array('simple', 'boolean'),
            array('content, keywords, title', 'safe')
        );
    }
}
